home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / pcw.zip / QPUTCHAR.C < prev    next >
Text File  |  1990-01-16  |  1KB  |  36 lines

  1. /***********************************************************/
  2. /* File Id.                  Qputchar.C                    */
  3. /* Author.                   Stan Milam.                   */
  4. /* Date Written.             11/06/88.                     */
  5. /* Date Last Modified.                                     */
  6. /*                                                         */
  7. /*           (c) Copyright 1989-90 by Stan Milam           */
  8. /*                                                         */
  9. /* Comments:  This routine will write a character at the   */
  10. /* specified location with the specified colors via an     */
  11. /* assembley langauge routine.                             */
  12. /***********************************************************/
  13.  
  14. #include <dos.h>
  15. #include "pcw.i"
  16. #include "pcwproto.h"
  17.  
  18. int qputchar(int row, int col, int fcolor, int bcolor, char ch) {
  19.  
  20.    int far  *scrnptr;
  21.    unsigned offset, scrnseg;
  22.    int attr, page, pagesize;
  23.    int mx_rows, mx_cols;
  24.  
  25.    if (!chk_video_state(&mx_rows,&mx_cols)) return(0);
  26.    if (row > mx_rows) return(0);
  27.    if (col > mx_cols) return(0);
  28.    page    = getpage();
  29.    scrnseg = getscrnseg();
  30.    pagesize= getpagesize();
  31.    offset  = MK_SCRNOFF(row,col);
  32.    attr    = MK_ATTR(fcolor,bcolor) | ch;
  33.    scrnptr = (int far *) MK_FP(scrnseg, offset);
  34.    Tputchar(scrnptr, attr); return(1);
  35. }
  36.